<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>网站管理平台</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<link rel="stylesheet" type="text/css" href="css/login.css"
	media="screen">
<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/verify.js"></script>
</head>
<%
	if (session.getAttribute("adminLogin") == null) {
		session.setAttribute("adminLogin", false);
	}
%>
<body>
	<script type="text/javascript">
		function myform_onsubmit() {
			if (document.myform.username.value == "") {
				alert("请填用户名！");
				document.myform.username.focus();
				return false;
			}
			if (document.myform.password.value == "") {
				alert("请填密码！");
				document.myform.password.focus();
				return false;
			}
			if (document.myform.rand.value == "") {
				alert("请填验证码！");
				document.myform.rand.focus();
				return false;
			}
		}
		function check() {
			var value = document.getElementById("verifyCode").value;
			$.ajax({
				type : "POST",
				url : "../CheckServlet",
				async : false,
				cache : false,
				data : {
					verifyCode : value
				},
				dataType : "json",
				success : function(result) {
					if (!result) {
						alert("验证码输入错误！");
						return false;
					}
				}
			});
		}
	</script>
	<table border="0" cellspacing="0" cellpadding="0" width="969"
		align="center">
		<form onsubmit="return myform_onsubmit()" method="post" name="myform"
			action="../AdminServlet" target="_parent">
			<tbody>
				<tr>
					<td><img alt="" src="images/login_01.gif" width="241"
						height="177"></td>
					<td><img alt="" src="images/login_02.gif" width="220"
						height="177"></td>
					<td><img alt="" src="images/login_03.gif" width="216"
						height="177"></td>
					<td><img alt="" src="images/login_04.gif" width="292"
						height="177"></td>
				</tr>
				<tr>
					<td valign="top" colspan="4"><img src="images/login_6-10.jpg"
						width="969" height="180" alt=""></td>
				</tr>
				<tr>
					<td><img alt="" src="images/login_10.gif" width="241"
						height="190"></td>
					<td class="login" colspan="2">
						<p>
							<label>用户帐号</label><input id="admin" name="username">
						</p>
						<p>
							<label>登录密码</label><input id="password" type="password"
								name="password">
						</p>
						<p></p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>验证码</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<input id="verifyCode" type="text" name="verifyCode" onblur="check()">&nbsp;&nbsp;&nbsp;<img
						src="img.jsp" id="rc" title="看不清？单击换一张图片" alt=""
						onclick="reloadImage()" />
						<p></p>
						<div>
							<input class="no_input" src="images/login.gif" type="image">
							<a href="javascript:window.close()"><img border="0"
								src="images/quxiao.gif" alt=""></a>
						</div>
					</td>
					<td><img alt="" src="images/login_12.gif" width="292"
						height="190"></td>
				</tr>
				<tr>
					<td><img alt="" src="images/login_13.gif" width="241"
						height="123"></td>
					<td height="123" valign="bottom" background="images/login_14.gif"
						colspan="2" align="middle"></td>
					<td><img alt="" src="images/login_15.gif" width="292"
						height="123"></td>
				</tr>
			</tbody>
			<input type="hidden" name="action" value="login">
		</form>
	</table>
</body>
</html>
